<!DOCTYPE html>
<html>
<head lang="en">
    <meta charset="UTF-8"/>
    <link rel="shortcut icon" href="favicon.ico" type="image/x-icon"/>
    <link href="bootstrap.min.css" rel="stylesheet"/>
    <title>TEMPLATE USER API</title>

    <style>
        body {
            font-family: "微软雅黑", Helvetica, Verdana, Arial, sans-serif;
        }
    </style>
</head>
<body class="container-fluid">
<h2 class="page-header">TEMPLATE USER API
    <small>1.1.1</small>
</h2>

<div class="alert alert-info">
    <strong>注意</strong>: 所有API请求都会返回
    <mark>statusCode</mark>和<mark>errors</mark>
    参数<span class="badge"> statusCode=0</span>则调用成功，反之出错，
    参数<span class="badge">errors</span>会有相应错误提示
    <br/>

    <p class="lead">
        该文档适用于USER的业务接口调用. 且在调用API时必须使用公司的二级域名.
    </p>
</div>

<div class="row">
    <div class="col-md-2">
        <div class="list-group">
            <a class="list-group-item" href="#getAccessToken">获取 access_token</a>
            <a class="list-group-item" href="#getPSSystemInfo">获取权限系统信息</a>
            <a class="list-group-item" href="#getAllRoles">获取权限系统所有角色</a>
            <a class="list-group-item" href="#getAllRolePermissions">获取角色的所有权限</a>
        </div>
    </div>
    <div class="col-md-10">
        <div class="row">
            <div class="col-md-12">
                <div class="well well-sm" id="getAccessToken">
                    <h3>创建用户
                        <small class="badge">public</small>
                    </h3>

                    <p class="text-info">创建一个可登陆的user账户</p>

                    <ul class="list-group">
                        <li class="list-group-item">
                            <p>
                                请求URI:
                                <br/>
                                <code>/api/v1/user</code> <span class="label label-warning">POST</span> <span
                                    class="label label-success">REST</span>
                            </p>

                            <p>
                                Content-Type:
                                <mark>application/json;charset=UTF-8</mark>
                            </p>
                            <div>
                                请求Body参数:
                                <table class="table table-bordered">
                                    <thead>
                                    <tr>
                                        <th>参数名</th>
                                        <th>参数值</th>
                                        <th>备注</th>
                                    </tr>
                                    </thead>
                                    <tbody>
                                    <tr>
                                        <td>username</td>
                                        <td>用户名称</td>
                                        <td>至少6位</td>
                                    </tr>
                                    <tr>
                                        <td>password</td>
                                        <td>用户密码</td>
                                        <td>至少8位</td>
                                    </tr>
                                    <tr>
                                        <td>privileges</td>
                                        <td>USER/ADMIN</td>
                                        <td>至少一个权限</td>
                                    </tr>
                                    </tbody>
                                </table>
                                请求Body示例:
                                <p>
                                    <code>{
											"username": "12",
											"password":"11",
											"privileges": [
												"USER",
												"ADMIN"
											]
										}</code>
                                </p>
                            </div>
                            <br/>
                            <strong>响应:</strong>
                            <pre>{
	"statusCode": 0,
	"errors": [],
	"uuid": "4e3fc06bf440a769f517dce206279717Jnfa24lf3QN",
	"username": "zhangdenghui",
	"privileges": [
		"USER",
		"ADMIN"
	],
	"successful": true
}
							</pre>
                            <p class="help-block">若有错误则<code>statusCode</code>不为0(HTTP状态码为800);</p>
                        </li>
                    </ul>

                </div>
            </div>
        </div>

        <hr/>
        <div class="row">
            <div class="col-md-12">
                <div class="well well-sm" id="getPSSystemInfo">
                    <h3>查询用户信息</h3>

                    <p class="text-info">通过用户名称查询用户信息</p>

                    <ul class="list-group">
                        <li class="list-group-item">
                            <p>
                                请求URI:
                                <br/>
                                <code>/api/v1/user?username=</code> <span
                                    class="label label-info">GET</span>
                                <span class="label label-success">REST</span>
                            </p>

                            <p>
                                Content-Type:
                                <mark>application/json;charset=UTF-8</mark>
                            </p>
                            <div>
                                请求参数:
                                <table class="table table-bordered">
                                    <thead>
                                    <tr>
                                        <th>参数名</th>
                                        <th>参数值</th>
                                        <th>备注</th>
                                    </tr>
                                    </thead>
                                    <tbody>
                                    <tr>
                                        <td>username</td>
                                        <td>用户名称</td>
                                        <td>query传递参数</td>
                                    </tr>
                                    </tbody>
                                </table>
                                请求示例:
                                <p>
                                    <code>/api/v1/user?username=zhangdenghui</code>
                                </p>
                            </div>
                            <br/>
                            <strong>响应:</strong>
                            <pre>
{
    "statusCode": 0,
    "errors": [],
    "uuid": "4e3fc06bf440a769f517dce206279717Jnfa24lf3QN",
    "username": "zhangdenghui",
    "privileges": [
        "USER",
        "ADMIN"
    ],
    "successful": true
}
                            </pre>
                            <p class="help-block">若有错误则<code>statusCode</code>不为0(HTTP状态码为800);</p>
                        </li>
                    </ul>

                </div>
            </div>
        </div>

        <hr/>
        <div class="row">
            <div class="col-md-12">
                <div class="well well-sm" id="getAllRoles">
                    <h3>编辑用户</h3>

                    <p class="text-info">编辑用户信息</p>

                    <ul class="list-group">
                        <li class="list-group-item">
                            <p>
                                请求URI:
                                <br/>
                                <code>/api/v1/user</code> <span
                                    class="label label-info">PUT</span>
                                <span class="label label-success">REST</span>
                            </p>

                            <p>
                                Content-Type:
                                <mark>application/json;charset=UTF-8</mark>
                            </p>
                            <div>
                                请求参数:
                                <table class="table table-bordered">
                                    <thead>
                                    <tr>
                                        <th>参数名</th>
                                        <th>参数值</th>
                                        <th>备注</th>
                                    </tr>
                                    </thead>
                                    <tbody>
									<tr>
                                        <td>uuid</td>
                                        <td>用户唯一识别码</td>
                                        <td>系统默认值</td>
                                    </tr>
                                    <tr>
                                        <td>username</td>
                                        <td>用户名称</td>
                                        <td>至少6位</td>
                                    </tr>
                                    <tr>
                                        <td>privileges</td>
                                        <td>USER/ADMIN</td>
                                        <td>至少一个权限</td>
                                    </tr>
                                    </tbody>
                                </table>
                                请求示例:
                                <p>
                                    <code>{
    "uuid": "17336cc43c0e1a00432532a25d87ec10putPyWxOsAH",
    "username": "gggggggggg",
    "privileges": [
        "USER"
    ]
}
									</code>
                                </p>
                            </div>
                            <br/>
                            <strong>响应:</strong>
                            <pre>
{
    "statusCode": 0,
    "errors": [],
    "uuid": "17336cc43c0e1a00432532a25d87ec10putPyWxOsAH",
    "username": null,
    "privileges": null,
    "successful": true
}
                            </pre>
                            <p class="help-block">若有错误则<code>statusCode</code>不为0(HTTP状态码为800);</p>
                        </li>
                    </ul>

                </div>
            </div>
        </div>

        <hr/>
        <div class="row">
            <div class="col-md-12">
                <div class="well well-sm" id="getAllRolePermissions">
                    <h3>删除用户信息</h3>

                    <p class="text-info">根据唯一码删除对应用户信息</p>

                    <ul class="list-group">
                        <li class="list-group-item">
                            <p>
                                请求URI:
                                <br/>
                                <code>/api/v1/user/{guid}</code> <span
                                    class="label label-info">GET</span>
                                <span class="label label-success">REST</span>
                            </p>

                            <p>
                                Content-Type:
                                <mark>application/json;charset=UTF-8</mark>
                            </p>
                            <div>
                                请求参数:
                                <table class="table table-bordered">
                                    <thead>
                                    <tr>
                                        <th>参数名</th>
                                        <th>参数值</th>
                                        <th>备注</th>
                                    </tr>
                                    </thead>
                                    <tbody>
                                    <tr>
                                        <td>guid</td>
                                        <td>{guid}</td>
                                        <td>用户唯一识别码</td>
                                    </tr>
                                    </tbody>
                                </table>
                                请求示例:
                                <p>
                                    <code>/api/v1/user/17336cc43c0e1a00432532a25d87ec10putPyWxOsAH</code>
                                </p>
                            </div>
                            <br/>
                            <strong>响应:</strong>
                            <pre>
{
    "statusCode": 0,
    "errors": [],
    "uuid": null,
    "username": null,
    "privileges": null,
    "successful": true
}
                            </pre>
                            <p class="help-block">若有错误则<code>statusCode</code>不为0(HTTP状态码为800);</p>
                        </li>
                    </ul>

                </div>
            </div>
        </div>
		
    </div>
</div>


<div class="row">
    <div class="col-md-12">
        <hr/>
        <p class="text-muted text-center">&copy; 2018 IDsManager.com</p>
    </div>
</div>
</body>
</html>